<?php


namespace app\services;


use app\jobs\OrderJob;
use app\model\Member;
use think\Request;

class Memberservices extends BaseServices
{

	public function lst () {
		$item = $this->findOne(['id' => 1], ['id', 'name']);
		$list = $this->findAll([
			['id', '>=', 30]
		], ['id', 'name'], ['id' => 'desc']);

		$data = [
			'name'        => '刘麻子',
			'mobile'      => 13053055170,
			'update_time' => time()
		];
		//Db类插入
		$this->insertRecord($data);
		//Db类修改
		$this->modifyRecord(['id' => 4], ['mobile' => 13053055679]);
		//修改数据,先查出一条后再使用模型的save修改
		$member = $this->findOne(['id' => 4]);
		$member->mobile = 13053055688;
		$member->save();

		return compact('item', 'list');
	}
}


